import {
	createSSRApp
} from "vue";

import * as Pinia from 'pinia'
// 导入样式到全局
import "@/static/icon/iconfont.css"

// import Vant from 'vant';
// import 'vant/lib/index.css';

import Message from "@/utils/Message"
import Request from "@/utils/Request";
import Api from "@/utils/Api";
import Utils from "@/utils/Utils";
import Confirm from "@/utils/Confirm";


import App from "./App.vue";


//引入 导航栏组件
import Navbar from "@/pages/components/common/Navbar.vue"
import DataList from "@/pages/components/common/DataList.vue"


export function createApp() {

	const app = createSSRApp(App);
	// 1. 使用Pinia 保存用户状态信息
	app.use(Pinia.createPinia());
    // app.use(Vant);
	// 注册全局组件
	app.component("Navbar", Navbar); // 顶部导航栏
	app.component("DataList", DataList) // 数据列表项

	app.config.globalProperties.Message = Message;
	app.config.globalProperties.Request = Request;
	app.config.globalProperties.Api = Api;
	app.config.globalProperties.Utils = Utils;
	app.config.globalProperties.Confirm = Confirm;

	return {
		app,
	};
}
